```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Spring AOP 实战应用指南 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background: #2d2d2d;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .use-case-card {
            transition: all 0.3s ease;
            border-left: 4px solid transparent;
        }
        .use-case-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            border-left-color: #6e8efb;
        }
        .nav-link {
            position: relative;
        }
        .nav-link::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 0;
            height: 2px;
            background-color: #6e8efb;
            transition: width 0.3s ease;
        }
        .nav-link:hover::after {
            width: 100%;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- 导航栏 -->
    <nav class="bg-white shadow-sm sticky top-0 z-50">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex items-center">
                    <span class="text-xl font-bold text-gray-800">技术小馆</span>
                </div>
                <div class="hidden md:flex items-center space-x-8">
                    <a href="#" class="nav-link text-gray-700 hover:text-gray-900">首页</a>
                    <a href="#" class="nav-link text-gray-700 hover:text-gray-900">Spring</a>
                    <a href="#" class="nav-link text-gray-700 hover:text-gray-900">AOP</a>
                    <a href="#" class="nav-link text-gray-700 hover:text-gray-900">设计模式</a>
                    <a href="#" class="nav-link text-gray-700 hover:text-gray-900">关于</a>
                </div>
            </div>
        </div>
    </nav>

    <!-- Hero 模块 -->
    <header class="hero-gradient text-white py-20">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4">Spring AOP 实战应用指南</h1>
                    <p class="text-xl mb-8 opacity-90">通过面向切面编程提升代码的模块化与可维护性</p>
                    <div class="flex space-x-4">
                        <a href="#introduction" class="bg-white text-blue-600 hover:bg-blue-50 px-6 py-3 rounded-lg font-medium transition duration-300">开始探索</a>
                        <a href="#use-cases" class="border-2 border-white text-white hover:bg-white hover:text-blue-600 px-6 py-3 rounded-lg font-medium transition duration-300">应用场景</a>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white bg-opacity-20 p-6 rounded-xl backdrop-blur-sm">
                        <div class="mermaid">
                            graph TD
                                A[Spring AOP] --> B[日志记录]
                                A --> C[事务管理]
                                A --> D[安全控制]
                                A --> E[缓存处理]
                                A --> F[性能监控]
                                A --> G[异常处理]
                                A --> H[自定义注解]
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- 主要内容 -->
    <main class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-16">
        <!-- 简介部分 -->
        <section id="introduction" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">Spring AOP 简介</h2>
            </div>
            <div class="bg-white rounded-xl shadow-md p-8 mb-12">
                <p class="text-lg text-gray-700 mb-6">在项目中，通过配置切面和通知的方式，Spring AOP实现了在方法执行前后插入日志记录、事务管理、权限控制等横切关注点，以及异常处理、性能监控等功能，提高了代码的可维护性和可扩展性。</p>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-gray-800">AOP 核心概念</h3>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-dot-circle text-blue-500 mt-1 mr-2"></i>
                                <span>切面(Aspect): 横切关注点的模块化，包含通知和切点</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-dot-circle text-blue-500 mt-1 mr-2"></i>
                                <span>连接点(Join Point): 程序执行过程中明确的点，如方法调用或异常抛出</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-dot-circle text-blue-500 mt-1 mr-2"></i>
                                <span>通知(Advice): 切面在特定连接点执行的动作</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-dot-circle text-blue-500 mt-1 mr-2"></i>
                                <span>切点(Pointcut): 匹配连接点的谓词</span>
                            </li>
                        </ul>
                    </div>
                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-gray-800">AOP 通知类型</h3>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-chevron-circle-right text-blue-500 mt-1 mr-2"></i>
                                <span><strong>@Before</strong>: 在方法执行前执行</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-chevron-circle-right text-blue-500 mt-1 mr-2"></i>
                                <span><strong>@AfterReturning</strong>: 在方法成功返回后执行</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-chevron-circle-right text-blue-500 mt-1 mr-2"></i>
                                <span><strong>@AfterThrowing</strong>: 在方法抛出异常后执行</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-chevron-circle-right text-blue-500 mt-1 mr-2"></i>
                                <span><strong>@After</strong>: 在方法结束后执行(无论是否成功)</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-chevron-circle-right text-blue-500 mt-1 mr-2"></i>
                                <span><strong>@Around</strong>: 环绕方法执行，功能最强大</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- 应用场景 -->
        <section id="use-cases" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">Spring AOP 应用场景</h2>
            </div>

            <!-- 日志记录 -->
            <div class="use-case-card bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-gray-100 p-6 flex items-center">
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1711595287741-d7bc0c03-bf51-4b15-91e2-1df138eb3f90.png" alt="日志记录" class="rounded-lg w-full">
                    </div>
                    <div class="md:w-2/3 p-8">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-file-alt text-blue-500 text-2xl mr-3"></i>
                            <h3 class="text-2xl font-bold text-gray-800">日志记录</h3>
                        </div>
                        <p class="text-gray-700 mb-6">在方法执行前后记录日志，用于监控和调试。</p>
                        <h4 class="font-semibold text-gray-800 mb-2">使用场景：</h4>
                        <p class="text-gray-700 mb-6">记录服务方法的调用，包括方法名和参数。</p>
                        
                        <div class="code-block p-4 mb-6">
                            <pre class="text-gray-300 text-sm overflow-x-auto"><code>@Aspect
@Component
public class LoggingAspect {

    @Before("execution(* com.example.service.*.*(..))")
    public void logBeforeMethod(JoinPoint joinPoint) {
        String methodName = joinPoint.getSignature().getName();
        String className = joinPoint.getTarget().getClass().getSimpleName();
        System.out.println("Before method " + className + "." + methodName + "() is called.");
    }

    @After("execution(* com.example.service.*.*(..))")
    public void logAfterMethod(JoinPoint joinPoint) {
        String methodName = joinPoint.getSignature().getName();
        String className = joinPoint.getTarget().getClass().getSimpleName();
        System.out.println("After method " + className + "." + methodName + "() is called.");
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 事务管理 -->
            <div class="use-case-card bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-gray-100 p-6 flex items-center">
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1711595395146-858c91a2-93d9-464c-b918-840a855138d6.png" alt="事务管理" class="rounded-lg w-full">
                    </div>
                    <div class="md:w-2/3 p-8">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-exchange-alt text-blue-500 text-2xl mr-3"></i>
                            <h3 class="text-2xl font-bold text-gray-800">事务管理</h3>
                        </div>
                        <p class="text-gray-700 mb-6">实现对数据库操作的事务管理，保证数据一致性和完整性。</p>
                        <h4 class="font-semibold text-gray-800 mb-2">使用场景：</h4>
                        <p class="text-gray-700 mb-6">在服务类的方法上添加事务，确保一系列数据库操作要么全部成功，要么全部失败。</p>
                        
                        <div class="code-block p-4 mb-6">
                            <pre class="text-gray-300 text-sm overflow-x-auto"><code>@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    @Transactional
    public void saveUser(User user) {
        userRepository.save(user);
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 安全控制 -->
            <div class="use-case-card bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-gray-100 p-6 flex items-center">
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1711595485316-a1f13ff5-4b7d-4a89-ad1d-792cf7f3fa95.png" alt="安全控制" class="rounded-lg w-full">
                    </div>
                    <div class="md:w-2/3 p-8">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-shield-alt text-blue-500 text-2xl mr-3"></i>
                            <h3 class="text-2xl font-bold text-gray-800">安全控制</h3>
                        </div>
                        <p class="text-gray-700 mb-6">在方法执行前进行权限验证，确保只有授权用户能访问敏感方法或资源。</p>
                        <h4 class="font-semibold text-gray-800 mb-2">使用场景：</h4>
                        <p class="text-gray-700 mb-6">使用自定义注解<code class="bg-gray-100 px-2 py-1 rounded">@RequirePermission</code>标注需要进行权限验证的方法。</p>
                        
                        <div class="code-block p-4 mb-6">
                            <pre class="text-gray-300 text-sm overflow-x-auto"><code>@Aspect
@Component
public class SecurityAspect {

    @Before("@annotation(com.example.annotation.RequirePermission)")
    public void checkPermission(JoinPoint joinPoint) {
        // 检查用户权限
        // ...
    }
}

// 自定义注解
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface RequirePermission {
    String value();
}

// 使用自定义注解
@Service
public class ProductService {

    @RequirePermission("admin")
    public void deleteProduct(Long productId) {
        // 删除产品
        // ...
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 缓存处理 -->
            <div class="use-case-card bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-gray-100 p-6 flex items-center">
                        <i class="fas fa-database text-6xl text-blue-500 w-full text-center"></i>
                    </div>
                    <div class="md:w-2/3 p-8">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-database text-blue-500 text-2xl mr-3"></i>
                            <h3 class="text-2xl font-bold text-gray-800">缓存处理</h3>
                        </div>
                        <p class="text-gray-700 mb-6">对方法的返回值进行缓存，提高系统性能。</p>
                        <h4 class="font-semibold text-gray-800 mb-2">使用场景：</h4>
                        <p class="text-gray-700 mb-6">使用自定义注解<code class="bg-gray-100 px-2 py-1 rounded">@Cacheable</code>标注需要进行缓存处理的方法。</p>
                        
                        <div class="code-block p-4 mb-6">
                            <pre class="text-gray-300 text-sm overflow-x-auto"><code>@Aspect
@Component
public class CacheAspect {

    @Around("@annotation(com.example.annotation.Cacheable)")
    public Object cacheResult(ProceedingJoinPoint joinPoint) throws Throwable {
        // 先查询缓存，如果有缓存直接返回结果
        // 如果没有缓存，执行方法并将结果缓存起来
        // ...
    }
}

// 自定义注解
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Cacheable {
    String value();
}

// 使用自定义注解
@Service
public class ProductService {

    @Cacheable("productCache")
    public Product getProductById(Long productId) {
        // 查询产品
        // ...
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 性能监控 -->
            <div class="use-case-card bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-gray-100 p-6 flex items-center">
                        <i class="fas fa-tachometer-alt text-6xl text-blue-500 w-full text-center"></i>
                    </div>
                    <div class="md:w-2/3 p-8">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-tachometer-alt text-blue-500 text-2xl mr-3"></i>
                            <h3 class="text-2xl font-bold text-gray-800">性能监控</h3>
                        </div>
                        <p class="text-gray-700 mb-6">统计方法的执行时间和资源使用情况，用于性能分析和优化。</p>
                        <h4 class="font-semibold text-gray-800 mb-2">使用场景：</h4>
                        <p class="text-gray-700 mb-6">通过AOP，在服务方法执行前后记录方法的执行时间。</p>
                        
                        <div class="code-block p-4 mb-6">
                            <pre class="text-gray-300 text-sm overflow-x-auto"><code>@Aspect
@Component
public class PerformanceMonitoringAspect {

    @Around("execution(* com.example.service.*.*(..))")
    public Object monitorPerformance(ProceedingJoinPoint joinPoint) throws Throwable {
        long startTime = System.currentTimeMillis();
        Object result = joinPoint.proceed();
        long endTime = System.currentTimeMillis();
        long executionTime = endTime - startTime;
        String methodName = joinPoint.getSignature().getName();
        String className = joinPoint.getTarget().getClass().getSimpleName();
        System.out.println("Method " + className + "." + methodName + "() executed in " + executionTime + " ms.");
        return result;
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 异常处理 -->
            <div class="use-case-card bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-gray-100 p-6 flex items-center">
                        <i class="fas fa-exclamation-triangle text-6xl text-blue-500 w-full text-center"></i>
                    </div>
                    <div class="md:w-2/3 p-8">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-exclamation-triangle text-blue-500 text-2xl mr-3"></i>
                            <h3 class="text-2xl font-bold text-gray-800">异常处理</h3>
                        </div>
                        <p class="text-gray-700 mb-6">统一处理方法抛出的异常，进行统一的异常处理和转换。</p>
                        <h4 class="font-semibold text-gray-800 mb-2">使用场景：</h4>
                        <p class="text-gray-700 mb-6">通过AOP，在方法执行过程中捕获异常，并进行统一的处理。</p>
                        
                        <div class="code-block p-4 mb-6">
                            <pre class="text-gray-300 text-sm overflow-x-auto"><code>@Aspect
@Component
public class ExceptionHandlingAspect {

    @AfterThrowing(pointcut = "execution(* com.example.service.*.*(..))", throwing = "ex")
    public void handleException(JoinPoint joinPoint, Exception ex) {
        String methodName = joinPoint.getSignature().getName();
        String className = joinPoint.getTarget().getClass().getSimpleName();
        System.out.println("Exception occurred in " + className + "." + methodName + "(): " + ex.getMessage());
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 自定义注解 -->
            <div class="use-case-card bg-white rounded-xl shadow-md overflow-hidden">
                <div class="md:flex">
                    <div class="md:w-1/3 bg-gray-100 p-6 flex items-center">
                        <i class="fas fa-tags text-6xl text-blue-500 w-full text-center"></i>
                    </div>
                    <div class="md:w-2/3 p-8">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-tags text-blue-500 text-2xl mr-3"></i>
                            <h3 class="text-2xl font-bold text-gray-800">自定义注解</h3>
                        </div>
                        <p class="text-gray-700 mb-6">使用AOP结合自定义注解，实现自定义逻辑的拓展。</p>
                        <h4 class="font-semibold text-gray-800 mb-2">使用场景：</h4>
                        <p class="text-gray-700 mb-6">自定义注解<code class="bg-gray-100 px-2 py-1 rounded">@CustomLogic</code>，通过AOP实现在带有该注解的方法执行前后执行自定义逻辑。</p>
                        
                        <div class="code-block p-4 mb-6">
                            <pre class="text-gray-300 text-sm overflow-x-auto"><code>@Aspect
@Component
public class CustomLogicAspect {

    @Around("@annotation(com.example.annotation.CustomLogic)")
    public Object applyCustomLogic(ProceedingJoinPoint joinPoint) throws Throwable {
        // 自定义逻辑在方法执行前执行
        System.out.println("Custom logic before method execution.");

        Object result = joinPoint.proceed();

        // 自定义逻辑在方法执行后执行
        System.out.println("Custom logic after method execution.");
        return result;
    }
}

// 自定义注解
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CustomLogic {
}

@Service
public class ProductService {

    @CustomLogic
    public void processProduct(Long productId) {
        // 执行自定义逻辑
        // ...
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 总结 -->
        <section class="bg-blue-50 rounded-xl p-8 mb-20">
            <h2 class="text-2xl font-bold text-gray-800 mb-6 flex items-center">
                <i class="fas fa-lightbulb text-blue-500 mr-3"></i>
                Spring AOP 使用总结
            </h2>
            <div class="grid md:grid-cols-2 gap-8">
                <div>
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">优势</h3>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>实现横切关注点的模块化，减少代码重复</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>业务逻辑与系统服务的分离，提高代码可维护性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>通过配置而非代码修改改变系统行为，提高灵活性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>简化复杂系统的开发与管理</span>
                        </li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">注意事项</h3>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-exclamation-circle text-yellow-500 mt-1 mr-2"></i>
                            <span>合理设计切点表达式，避免性能问题</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-exclamation-circle text-yellow-500 mt-1 mr-2"></i>
                            <span>避免过度使用AOP，保持代码可读性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-exclamation-circle text-yellow-500 mt-1 mr-2"></i>
                            <span>注意AOP代理的局限性(如自调用问题)</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-exclamation-circle text-yellow-500 mt-1 mr-2"></i>
                            <span>合理处理异常，避免"吞没"异常</span>
                        </li>
                    </ul>
                </div>
            </div>
        </section>
    </main>

    <!-- 页脚 -->
    <footer class="bg-gray-900 text-gray-400 py-12">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-6 md:mb-0">
                    <h3 class="text-white text-xl font-bold mb-2">技术小馆</h3>
                    <p class="text-sm">专注分享高质量技术内容</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-400 hover:text-white transition duration-300 flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i>
                        http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-sm">
                <p>© 2024 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'dark',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```